<template>
    <div>
            <filtrate></filtrate>
        <div class="info">
            <div class="info_box" v-for="item in list">
                <div class="shangp animate__animated" 
                :class="{  
                    animate__zoomOutLeft : item.id == index,
                    animate__zoomInLeft : item.id == index1
                }"  
                @mouseover="yiru(item.id)">
                    <img :src="item.imag" alt="">
                    <div class="jine">￥ {{item.jiage}}.00</div>
                    <div class="shouru">预计收入2.8元 </div>
                </div>
                <div class="xianshi animate__animated" 
                :class="{
                    animate__zoomInLeft : item.id == index,
                    animate__zoomOutLeft :item.id == index1,
                    diapa : item.id != aaa
                }" >
                <xiangqing :item='item' @yichu='yichu(item.id)'></xiangqing>
                </div>
            </div>
            
        </div>
    </div>
</template>

<script>
import xiangqing  from './xiangqing.vue';
import filtrate from '../../../components/lef_nav/filtrate.vue';
import http from '../../../http/http'
export default {
    data() {
        return {
            index:2,
            index1:5,
            list:[],
            aaa:null 
        }
    },
    methods:{
       yiru(index){
           this.index = index
           this.index1 = 88
           this.aaa = index
       },
       yichu(index){
           this.index1 = index
           this.index= 55
        //    this.aaa=null
       }
   },
   components: {
       xiangqing,
       filtrate
   },
   created(){
       http.inget()
       .then(res=>{
        //    console.log(res.data);
           this.list=res.data
       })
   }
};
</script>

<style lang="scss" scoped>

.info{
    padding-top: 50px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    .info_box{
        overflow: hidden;
        margin-top: 20px;
        position: relative;
        width: 13%;
        height: 180px;
        .shangp{
            width: 100%;
            font-weight: 700;
            img{
                width: 120px;
                height: 120px;
            }
            .jine{
                font-size: 14px;
            }
            .shouru{
                font-size: 12px;
            }
            
        }
        .xianshi{
            // display: none;
            border-radius: 10px;
            position: absolute;
            width: 95%;
            left: 3%;
            top: 15px;
        }
        .diapa{
            display: none;
        }
    }
}
</style>